import Mock from 'mockjs';
import setupMock, {
  successResponseWrap,
  failResponseWrap,
} from '@/utils/setup-mock';

setupMock({
  setup() {
    // Mock.XHR.prototype.withCredentials = true;

    // 用户信息
    Mock.mock(new RegExp('/api/config/common/list'), () => {
      const resData = {
        //科室
        departments: [
          { name: "放射科", value: "1" },
          { name: "病理科", value: "2" },
          { name: "内科", value: "3" },
        ],
        任务状态: [
          { name: "未发布", value: "0" },
          { name: "进行中", value: "1" },
          { name: "已完成", value: "2" },
          { name: "已终结", value: "3" },
        ],
        // 任务用途
        taskUses: [
          { name: "标注训练集", value: "1" },
          { name: "标注验证集", value: "2" },
        ],
        // 标注单位
        标注单位: [
          { name: "单位1", value: "1" },
          { name: "单位2", value: "2" },
        ],
        // 标注标签
        taskLabels: [
          { name: "肺结节", value: "1" },
          { name: "手骨折", value: "2" },
        ],
        //任务目标
        taskTargets: [
          { name: "分类", value: "1" },
          { name: "检出", value: "2" },
        ],
        // 医生姓名
        医生姓名: [
          { name: "医生1", value: "1" },
          { name: "医生2", value: "2" },
        ],
        // 废片原因
        discardReasons: [
          { name: "背景复杂", value: "1" },
          { name: "部位不匹配", value: "2" },
          { name: "其他", value: "E005" },
        ],
        // 窗宽窗位
        windows: [
          { name: "CT脑窗", value: "1" },
          { name: "CT骨窗", value: "2" },
        ],
        // 影响布局
        imageLayouts: [
          { name: "MPR", value: "1" },
          { name: "原始数据", value: "2" },
        ],
        imageAnnos: [
          {
            "name": "脑血管分割",
            "value": "CEREBROVASCULAR_SEGMENT",
            "colour": null,
            "childImageAnnos": []
          },
          {
            "name": "病理病症集1",
            "value": "PATHOLOGY_C1",
            "colour": null,
            "childImageAnnos": [
              {
                "name": "细胞坏死",
                "value": "PATHOLOGY_C1_1",
                "colour": "#556B2F",
                "childImageAnnos": null
              },
              {
                "name": "细胞病变",
                "value": "PATHOLOGY_C1_2",
                "colour": "#9400D3",
                "childImageAnnos": null
              }
            ]
          },
        ],
        imageTools: [
          {
              "name": "圆形",
              "value": "ELLIPSE"
          },
          {
              "name": "矩形",
              "value": "RECTANGLE"
          },
          {
              "name": "直线",
              "value": "LINE"
          },
        ]

      }
      return successResponseWrap(resData);
    });
  },
});
